﻿
Namespace ind.cte
    ''' <summary>
    ''' generic vars for the application
    ''' </summary>
    ''' <remarks></remarks>
    Public Class AppVars

        ''' <summary>
        ''' load user settings
        ''' </summary>
        ''' <remarks></remarks>
        Public Shared Sub LoadUserSettings()
            'put here the vars that are not loaded directly inline

            My.Application.ChangeUICulture(ind.settings.SettingsLink.LanguageSelected)

        End Sub
        ''' <summary>
        ''' When the user is not validated some functions are not available
        ''' </summary>
        ''' <remarks></remarks>
        Public Shared UserValidated As Boolean = False
        ''' <summary>
        ''' password introduced by user
        ''' </summary>
        ''' <remarks></remarks>
        Private Shared AppPasswordVar As String
        ''' <summary>
        ''' password introduced by user
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Shared Property AppPassword As String

            Get
                Return ind.cte.AppVars.AppPasswordVar
            End Get
            Set(value As String)
                If Not value Is Nothing Then
                    ind.cte.AppVars.AppPasswordVar = value.Trim
                Else
                    ind.cte.AppVars.AppPasswordVar = ""
                End If

            End Set
        End Property

        Private Shared chkOpenAfterDecryptVar As Boolean = ind.settings.SettingsLink.chkOpenAfterDecrypt
        ''' <summary>
        ''' global option for opening files after decrypt
        ''' </summary>
        ''' <remarks></remarks>
        Public Shared Property chkOpenAfterDecrypt As Boolean

            Get
                Return ind.cte.AppVars.chkOpenAfterDecryptVar
            End Get
            Set(value As Boolean)
                ind.cte.AppVars.chkOpenAfterDecryptVar = value
                ind.settings.SettingsLink.chkOpenAfterDecrypt = value
            End Set
        End Property



        Private Shared chkNotDecryptWithoutExtensionVar As Boolean = ind.settings.SettingsLink.chkNotDecryptWithoutExtension
        ''' <summary>
        ''' global option to avoid decrypt files without app extension
        ''' </summary>
        ''' <remarks></remarks>
        Public Shared Property chkNotDecryptWithoutExtension As Boolean

            Get
                Return ind.cte.AppVars.chkNotDecryptWithoutExtensionVar
            End Get
            Set(value As Boolean)
                chkNotDecryptWithoutExtensionVar = value
                ind.settings.SettingsLink.chkNotDecryptWithoutExtension = value
            End Set
        End Property

        Private Shared chkIntegrateInWindowsMenuVar As Boolean = ind.settings.SettingsLink.chkIntegrateInWindowsMenu
        ''' <summary>
        ''' global option to avoid decrypt files without app extension
        ''' </summary>
        ''' <remarks></remarks>
        Public Shared Property chkIntegrateInWindowsMenu As Boolean

            Get
                Return ind.cte.AppVars.chkIntegrateInWindowsMenuVar
            End Get
            Set(value As Boolean)
                chkIntegrateInWindowsMenuVar = value
                ind.settings.SettingsLink.chkIntegrateInWindowsMenu = value
            End Set
        End Property

        Private Shared chkStartWithWindowsVar As Boolean = ind.settings.SettingsLink.chkStartWithWindows
        ''' <summary>
        ''' global option to ask  to save modified projects on exit
        ''' </summary>
        ''' <remarks></remarks>
        Public Shared Property chkStartWithWindows As Boolean

            Get
                Return ind.cte.AppVars.chkStartWithWindowsVar
            End Get
            Set(value As Boolean)
                chkStartWithWindowsVar = value
                ind.settings.SettingsLink.chkStartWithWindows = value
            End Set
        End Property
        
    End Class
End Namespace


